package com.newhis.pattern.chain;

/**
 * 业务聚合
 *
 * @version [V2.0]
 * @package com.newhis.newhisbase.pattern.chain;
 * @description:[用一句话描述该文件做什么]
 * @author: [zhuben]
 * @date: [2024-07-14 13:20]
 * @copyright: 2024 echovin.com
 */

public class WarnLogger extends AbstractLogger{

    private WarnLogger() {
    }

    private WarnLogger(int level) {
        this.level = level;
    }

    public static WarnLogger getInstance(){
        WarnLogger warnLogger = WarnLoggerHolder.warnLogger;
        warnLogger.setNext(InfoLogger.getInstance());
        return warnLogger;
    }

    private static class WarnLoggerHolder{
        private static final WarnLogger warnLogger = new WarnLogger(1);
    }

    @Override
    void write(String message) {
        System.out.println(message);
    }
}
